<?php

namespace app\common\enums;

class GrammarLearnPaceEnum extends BaseEnum
{
    // 定义常量
    public const E1 = '1';
    public const E2 = '2';
    public const E3 = '3';
    public const E4 = '4';
    public const E5 = '5';
    public const E6 = '6';



    // 定义描述
    public array $description = [
        self::E1 => '未学习',
        self::E2 => '在学习中',
        self::E3 => '仍需巩固',
        self::E4 => '基本掌握',
        self::E5 => '已经掌握',
        self::E6 => '完美掌握',
    ];

    public array $sort = [
        self::E1 => '0',
        self::E2 => '1',
        self::E3 => '2',
        self::E4 => '3',
        self::E5 => '4',
        self::E6 => '5',
    ];

    public function getSort($key)
    {
        return $this->sort[$key] ?? null;
    }

    public array $progress = [
        self::E1 => '0.0',
        self::E2 => '20.0',
        self::E3 => '20.0',
        self::E4 => '20.0',
        self::E5 => '20.0',
        self::E6 => '20.0',
    ];

    public function getProgress($key)
    {
        return $this->progress[$key] ?? null;
    }
}
